package com.guigu.springcloud.controller;


import com.guigu.springcloud.common.CommonResult;
import com.guigu.springcloud.entity.Payment;
import com.guigu.springcloud.service.PaymentFeignService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/consumer/feign")
public class PaymentFeignController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping(value = "/{id}")
    public CommonResult findById(@PathVariable("id") Long id) {
        return paymentFeignService.findById(id);
    }

    @PostMapping
    public CommonResult create(@RequestBody Payment payment) {
        return paymentFeignService.create(payment);
    }


}
